<template>
  <div>
    <!-- end top -->
    <div class="zxcf_nav_wper">
      <div class="zxcf_nav clearfix px1000">
        <div class="zxcf_nav_l fl"><img src="../assets/11112/images/zxcf_logo_meitu_1.jpg" alt=""></div>
        <div class="zxcf_nav_r fr" v-show="isLogin">
          <img src="../assets/11112/images/zxcf_perinfo.png" alt="">
          <span @click="changeModule('settings')">我的账户
          <img src="../assets/11112/images/zxcf_icon01.png" alt=""></span>
          <ul class="zxcf_perinfo" style="display:none;">
            <li><a href="#">111</a></li>
            <li><a href="#">111</a></li>
            <li><a href="#">111</a></li>
          </ul>
        </div>
        <div class="zxcf_nav_r fr" v-show="!isLogin">
          <img src="../assets/images/lg_pic01.png" alt="">
          <span>
		    <a href="src/components/index2.vue" >返回首页</a></span>

        </div>
      </div>
    </div>
    <div class="zxcf_top_wper">
      <div class="zxcf_top px1000 clearfix">
        <div class="zxcf_top_l fl">
          <img src="../assets/11112/images/zxcf_phone.png" alt="">
          400-027-0101(工作时间9:00-17:30)
          <a href="#"><img src="../assets/11112/images/zxcf_weixin.png" alt=""></a>
          <a href="#"><img src="../assets/11112/images/zxcf_sina.png" alt=""></a>
          <a href="#"><img src="../assets/11112/images/zxcf_qq.png" alt=""></a>
        </div>
        <div class="zxcf_top_r fr">
          <a href="javascript:void (0)" class="curspan" @click="changeModule('login')" v-show="!isLogin">立即登录</a>
          <a href="javascript:void (0)" class="curspan" @click="logout" v-show="isLogin">注销登录</a>
          <span>|</span>
          <a href="javascript:void (0)" @click="changeModule('register')">免费注册</a>
          <span>|</span>
          <a href="javascript:void (0)" @click="changeModule('noticelist')">常见问题</a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import bus from '../assets/eventBus'
    export default {
        name: "projecthead",
      data(){
          return{
            moName:"index",
            isLogin:window.sessionStorage.user!=null
          }
      },
      methods:{
          changeModule:function (t) {
            this.index=t
            this.$emit("func",t)
          },
        logout:function () {
          // this.axios.post("/api/delete/"+id)
          //   .then((data)=>{
          //     alert(data.data.title+"删除成功")
          //   })
          localStorage.token=0;
          window.sessionStorage.removeItem('user');
          this.isLogin=false
        }

      },
      mounted() {
          bus.$on('login',(e)=>{
            this.isLogin=e
          })
      }
    }
</script>

<style scoped>

</style>
